package com.zhongfl.crm.service.boss;

import com.zhongfl.crm.enums.boss.OrderAttachmentType;
import com.zhongfl.crm.model.boss.OrderAttachment;
import com.zhongfl.crm.model.boss.OrderAttachmentQuery;

import java.util.List;

/**
 * 订单附件表Service
 * @author wang.yuchuan
 * @date 2018/5/4
 */
public interface OrderAttachmentService {

    List<OrderAttachment> findByQuery(OrderAttachmentQuery queryInfo);

    List<OrderAttachment> findByOrderNo(String orderNo);

    List<OrderAttachment> findByFilePath(String filePath);

    List<OrderAttachment> findByOrderNoAndKey(String orderNo, OrderAttachmentType key);

    void deleteByFilePath(String filePath, String deleteBy);

    /**
     * 保存订单附件信息
     * @param orderAttachment 订单附件信息
     */
    void save(OrderAttachment orderAttachment);

    /**
     * 通过workOrderNo和key查询
     * @param workOrderNo workOrderNo
     * @param key key
     * @return list
     */
    List<OrderAttachment> findByWorkOrderNoAndKey(String workOrderNo, OrderAttachmentType key);

    /**
     * 根据workOrderNo和跟进记录类型删除
     * @param workOrderNo workOrderNo
     * @param orderAttachmentType 跟进记录类型
     * @param staffName 当前登录人姓名（操作人）
     */
    void deleteByWorkOrderNoAndKey(String workOrderNo, OrderAttachmentType orderAttachmentType, String staffName);
}
